/*
  {
    "spuId": 0,
    "category3Id": 0,
    "skuName": "string",
    "price": 0,
    "weight": "string"
    "skuDesc": "string",
    "skuAttrValueList": [
      {
        "attrId": 0,
        "attrName": "string",
        "valueId": 0,
        "valueName": "string"
      }
    ],
    "skuSaleAttrValueList": [
      {
        "saleAttrId": 0,
        "saleAttrName": "string",
        "saleAttrValueId": 0,
        "saleAttrValueName": "string",
      }
    ],
    "skuImageList": [
      {
        "imgName": "string",
        "imgUrl": "string",
        "isDefault": "string",
      }
    ],
    "skuDefaultImg": "string",
}
*/
// 图片
export type IsDefault = '0' | '1'
export interface SkuImageItem {
    imgName: string;
    imgUrl: string;
    isDefault: IsDefault;
  }
  
export type SkuImageList = SkuImageItem[];

export interface SkuSaleAttrValueItem {
  saleAttrId: number;
  saleAttrName: string;
  saleAttrValueId: number;
  saleAttrValueName: string;
}

export type SkuSaleAttrValueList = SkuSaleAttrValueItem[];

export interface SkuAttrValueItem {
  attrId: number;
  attrName: string;
  valueId: number;
  valueName: string;
}

export type SkuAttrValueList = SkuAttrValueItem[];

export interface SkuItem {
//   spuId: number;
//   category3Id: number;
  skuName: string;
  price: number;
  weight: number;
  skuDesc: string;
//   skuAttrValueList: SkuAttrValueList;
//   skuSaleAttrValueList: SkuSaleAttrValueList;
  skuImageList: SkuImageList;
  skuDefaultImg: string;
}

// 组件使用的数据类型
export interface SaveSkuItem  extends SkuItem{
    skuAttrValueList: string[];
    skuSaleAttrValueList: string[];
}

// 发送请求需要的数据类型
export interface SaveSkuApiParams extends SkuItem {
    spuId: number;
    category3Id: number;
    skuAttrValueList: SkuAttrValueList;
    skuSaleAttrValueList: SkuSaleAttrValueList;
}